import request from '@/utils/request'

// 查询仓库商品列表
export function getProduct(query) {
  return request({
    url: '/basic/warehouse/product/',
    method: 'get',
    params: query
  })
}


// 查询仓库全部商品
export function getProductTotal(query) {
  return request({
    url: '/basic/warehouse/product/refer',
    method: 'get',
    params: query
  })
}


// 查询商品详情
export function getProductDetail(query) {
  return request({
    url: '/basic/warehouse/product/'+query,
    method: 'get'
  })
}


// 仓库商品上下架
export function enableProduct(query) {
  return request({
    url: '/basic/warehouse/product/enable/',
    method: 'get',
    data: query
  })
}


// 修改仓库商品
export function updateProduct(query) {
  return request({
    url: '/basic/warehouse/product/',
    method: 'put',
    data: query
  })
}


// 新增仓库商品
export function addProduct(query) {
  return request({
    url: '/basic/warehouse/product/',
    method: 'post',
    data: query
  })
}


// 删除仓库商品
export function delProduct(query) {
  return request({
    url: '/basic/warehouse/product/'+query,
    method: 'delete',
  })
}


// 仓库商品上下架
export function ProductEnable(query) {
  return request({
    url: '/basic/warehouse/product/enable',
    method: 'put',
    params: query
  })
}
//商品日志
export function productLog(query) {
  return request({
    url: '/basic/warehouse/productLog/',
    method: 'get',
    params: query
  })
}
//筛选仓库已经有的商品下拉
export function restProductList(query) {
  return request({
    url: '/config/product/warehouseRefer',
    method: 'get',
    params: query
  })
}
